//封装师资管理需要的所有请求
import { post } from '../ck/plugin/axios'

class TeachersManage {
  //添加教师接口
  static async addTeachers ({
    Name,
    Image,
    Describe,
    Phone
  }) {
    return post('api/Manage/Teacher/Add', {
      Name,
      Image,
      Describe,
      Phone
    })
  }

  //查询教师集合
  static async PageSearchList(){
    return post('api/Manage/Teacher/PageSearchList')
  }

  //获取教师列表+查询
  static async getTeachersList ({
    Name,
    Phone,
    Page,
    Limit
  }) {
    return post('api/Manage/Teacher/PageSearch', {
      Name,
      Phone,
      Page,
      Limit
    })
  }

  //展示教师列表信息
  static async showTeachersInfo (ID) {
    return post('api/Manage/Teacher/SearchModelDetails', { ID })
  }

  //真正提交编辑表单时候调用的接口
  static async editTeachersInfo (ID, {
    Name,
    Image,
    Describe,
    Phone
  }) {
    return post('api/Manage/Teacher/Update',
      {
        ID,
        Name,
        Image,
        Describe,
        Phone
      })
  }

  //删除教师信息
  static  async deleteTeachersInfo(ID){
    return post('api/Manage/Teacher/Delete',{ID})
  }

  //置顶教师信息
  static async topTeachersInfo(ID)
  {
    return post('api/Manage/Teacher/SetTop',{ID})
  }

}

export default TeachersManage

